switch to Files Node API for zip generation#17822
Conversation
|
/backport to stable17 |
lib/private/legacy/files.php
Outdated
| $fileTime = \OC\Files\Filesystem::filemtime($file); | ||
| $fh = \OC\Files\Filesystem::fopen($file, 'r'); | ||
| $streamer->addFileFromStream($fh, basename($file), $fileSize, $fileTime); | ||
| $owner = \OC\Files\Filesystem::getOwner($file); |
There was a problem hiding this comment.
this shouldn't use the owner but the current user
There was a problem hiding this comment.
@icewind1991 what about unauthenticated users, on public shares?
There was a problem hiding this comment.
They have the "current user" set correctly afaik, since it's also needed for the old Filesystem stuff to work (worth double testing though)
There was a problem hiding this comment.
nope, using $userFolder = \OC::$server->getUserFolder(); returns null in that case. Of cours we can try that first and fall back to the owner? Or does it open any loophole? Previously it also only just read it. IIRC it's best to avoid using root folder directly for performance.
There was a problem hiding this comment.
\OC::$server->getRootFolder()->get(Filesystem::getRoot()) would always have the same behavior as using the old api
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
4852da5 to
f9bfd48
Compare
|
/backport to stable16 |
|
backport to stable17 in #17840 |
|
backport to stable16 in #17841 |
since it is disencouraged to use the static Filesystem methods